function initFingerprint(e,i,t,o,n){if(t&&("string"==typeof t||"number"==typeof t)){var r=e.createElement("iframe"),a=e.getElementsByTagName("body")[0];r.src=i+t,r.id=o,n&&(r.allow=n),r.style="position:absolute;width:0;height:0;border:0;",a.appendChild(r)}}var FINGERPRINT_SUCCESS_MESSAGE="FP_OK",SESSION_ID_EXPIRES_HOURS=24,DEVICE_ID_EXPIRES_HOURS=8760;function SCODE(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function getUUID(){return SCODE()+SCODE()+SCODE()+SCODE()+SCODE()+SCODE()+SCODE()+SCODE()}function setCookie(e,i,t,o){var n=new Date;n.setTime(n.getTime()+3600*t*1e3);var r="expires="+n.toUTCString();return document.cookie=e+"="+i+";"+r+";path="+o+";SameSite=none; Secure; Partitioned",fp_cookie()&&-1!==document.cookie.indexOf(e)||window&&"undefined"!=typeof window&&getLocalStorage(window)&&window.localStorage.setItem(e,i),i}function readCookie(e){var t=e+"=",o=document.cookie.split(";"),n=o.length;for(i=0;i-1)return o[i].split("=")[1]}if(getLocalStorage(window)&&window.localStorage.getItem(e))return window.localStorage.getItem(e)}function fp_cookie(){"use strict";var e=!1;try{return e=!(!window.navigator||!window.navigator.cookieEnabled),"undefined"!=typeof navigator.cookieEnabled||e||(document.cookie="__fp_test_Cookie",e=-1!==document.cookie.indexOf("__fp_test_Cookie")),e}catch(i){return e}}function getLocalStorage(e){try{return e.localStorage!==undefined}catch(i){return!1}}var RISKIFIED_DEFAULT_SHOP_DOMAIN="koin.com.br",RISKIFIED_DESPEGAR_SHOP_DOMAIN="koin.despegar.com",organizations={xzHp27YKna:{despegar:!0,threatmetrix:!0,riskified:!0,riskifiedIndustry:"retail",riskifiedShop:RISKIFIED_DEFAULT_SHOP_DOMAIN},"1vhccjqm":{despegar:!0,threatmetrix:!0,riskified:!0,riskifiedIndustry:"",riskifiedShop:RISKIFIED_DESPEGAR_SHOP_DOMAIN},"default":{despegar:!0,threatmetrix:!0,riskified:!1}};function getOrganization(e){return organizations[e]||organizations["default"]}var RISKIFIED_BACON_DOMAIN="beacon.riskified.com";function riskifiedBeaconLoad(e,i="",t="",o){var n=("https:"==document.location.protocol?"https://":"http://")+RISKIFIED_BACON_DOMAIN+"?shop="+t+(i?"_"+i:"")+"&sid="+e,r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=n,r.id=o;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a)}var orgId=document.getElementById("deviceId_fp").getAttribute("org_id"),sessionId=document.getElementById("deviceId_fp").getAttribute("session_id"),SESSION_COOKIE_NAME="__sessionId_cookie",THREAT_METRIX_ORG_ID="1vhccjqm",TM_IFRAME_URL="https://h.online-metrix.net/fp/tags?org_id="+THREAT_METRIX_ORG_ID+"&pageid=1&session_id=",DF_IFRAME_URL="https://securegtm.despegar.com/risk/fingerprint/statics/track.html?org_id="+orgId+"&session_id=",DF_IFRAME_ID="__k_fingerprint_iframe__",TM_IFRAME_ID="__tm_fingerprint_iframe__",RISKIFIED_SC="__rf_integration_script__",organizationProps=getOrganization(orgId);function setSessionID(e,i){if(e&&"string"==typeof e&&setCookie(SESSION_COOKIE_NAME,e,SESSION_ID_EXPIRES_HOURS,"/"),null!=i&&"function"==typeof i){const t=t=>{"https://securegtm.despegar.com"===t.origin&&t.data===FINGERPRINT_SUCCESS_MESSAGE&&i(e)};window.addEventListener("message",t)}if(organizationProps.despegar){var t=e.replace(orgId+"_","");initFingerprint(document,DF_IFRAME_URL,t,DF_IFRAME_ID)}organizationProps.threatmetrix&&((t=e.replace(orgId,THREAT_METRIX_ORG_ID)).length<9&&(t=THREAT_METRIX_ORG_ID+"_"+t),initFingerprint(document,TM_IFRAME_URL,t,TM_IFRAME_ID,"camera;microphone"));organizationProps.riskified&&riskifiedBeaconLoad(e,organizationProps.riskifiedIndustry,organizationProps.riskifiedShop,RISKIFIED_SC)}function getSessionID(e){setSessionID(readCookie(SESSION_COOKIE_NAME)||setCookie(SESSION_COOKIE_NAME,getUUID(),SESSION_ID_EXPIRES_HOURS,"/"),e)}sessionId&&"string"==typeof sessionId&&setSessionID(sessionId);